//
// Created by yinlijun on 2017/9/30.
//

#ifndef ROCKYSOCKET_WORK_ITEM_QUEUE_H
#define ROCKYSOCKET_WORK_ITEM_QUEUE_H
#ifdef __cplusplus
extern "C" {
#endif

typedef void (*work_item_destroy_func)(void *data);

typedef void (*work_item_queue_foreach_func)(void* data, void* ctx);

typedef struct WorkItemQueue WorkItemQueue;

WorkItemQueue *work_item_queue_create();

WorkItemQueue *work_item_queue_add(WorkItemQueue *thiz, void *data, work_item_destroy_func destroy);

void *work_item_queue_peek(WorkItemQueue* thiz);

void *work_item_queue_remove(WorkItemQueue *thiz);

void work_item_queue_foreach(WorkItemQueue *thiz, work_item_queue_foreach_func foreach_func, void* ctx);

int work_item_queue_get_count(WorkItemQueue* thiz);

void work_item_queue_destroy(WorkItemQueue *thiz);

#ifdef __cplusplus
}
#endif

#endif //ROCKYSOCKET_WORK_ITEM_QUEUE_H
